package com.hnx.admin.aurora.system.mapper.role;

import com.hnx.admin.aurora.annotation.AddInfo;
import com.hnx.admin.aurora.annotation.UpdateInfo;
import com.hnx.admin.aurora.system.domain.dto.role.entity.RoleDTO;
import com.hnx.admin.aurora.system.domain.param.role.form.RoleDelForm;
import com.hnx.admin.aurora.system.domain.param.role.form.RoleForm;
import com.hnx.admin.aurora.system.domain.param.role.query.RoleQuery;
import com.hnx.admin.aurora.system.domain.param.user.form.RoleStateForm;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RoleMapper {
    List<RoleDTO> getRoleByUserId(String userId);

    List<RoleDTO> selectRoleAll();

    List<RoleDTO> selectRoleList(RoleQuery role);

    RoleDTO selectRoleById(String roleId);
    @UpdateInfo
    int updateRole(RoleForm role);
    @AddInfo
    int insertRole(RoleForm role);
    int deleteRoleByIds(RoleDelForm roleDelForm);
    int authDataScope(RoleForm role);
    @UpdateInfo
    @Update("update sys_role set status=#{status} where role_id=#{roleId}")
    int updateRoleStatus(RoleStateForm role);
}
